home *** CD-ROM | disk | FTP | other *** search
/ Run Magazine ReRun 1991 September & October / rerun-1991-09-10.d64 / elapsed time (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  5KB  |  166 lines

  1. 5 sd=54272:fori=sdtosd+23:pokei,0:next:pokesd+24,15:poke788,52:p$="menu runner"
  2. 10 goto115
  3. 15 poke v+21,0:print"[147]"
  4. 17 printtab(14)"[159]loading me[158]n[159]u":print"[144]load"chr$(34)p$chr$(34)",8"
  5. 20 poke198,4:poke631,13:poke632,82:poke633,213:poke634,13:end
  6. 25 print"[147]":pokev+21,0:poke53280,14:poke53281,14:sys64738
  7. 30 for w=1 to 1700:next w
  8. 35 poke 198,0
  9. 40 for c=1 to 10
  10. 45 get c$:if c$="[136]"then15
  11. 50 if c$="[140]"then25
  12. 55 if c$<>"[136]"andc$<>"[140]"andc$<>""then115
  13. 60 next
  14. 65 printtab(13)"[146]press any key[145]"
  15. 70 for d=1 to 35
  16. 75 get d$:if d$="[136]"then15
  17. 80 if d$="[140]"then25
  18. 85 if d$<>"[136]"andd$<>"[140]"andd$<>""then115
  19. 90 next
  20. 95 printtab(13)"[152]press[146] any[146] key[145]"
  21. 100 goto40
  22. 105 printtab(19)"[145]             [157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157]";:return
  23. 110 printtab(21+len(s$))"[145] [157]":s$="":return
  24. 115 gosub720:print chr$(142);chr$(8)"[147]":poke198,0:poke53280,12:poke53281,0
  25. 120 for x=1 to 2:pokev+21,0:md=0:l=0:y$="0":m$="0":d$="0":ah$="0"
  26. 125 if x=1 then printtab(7)" from:[146]"tab(13)
  27. 130 if x=2 then printtab(9)" to:[146]"tab(13)
  28. 135 print" year ?[150] ";:y$=""
  29. 136 if xx>10 then xx=0
  30. 137 if xx>5 then print" [157]";:goto 142
  31. 140 print"[164][157]";
  32. 142 get a$
  33. 145 if a$="[136]"then15
  34. 150 if a$="[140]"then25
  35. 155 if a$=chr$(19) then115
  36. 160 if a$=chr$(20) then print:gosub720:gosub105:goto135
  37. 165 if a$=chr$(13) then print:s$=y$:gosub110:goto185
  38. 170 if a$<"0" or a$>"9" then182
  39. 175 if len(y$)>3 then 182
  40. 180 print a$;:y$=y$+a$
  41. 182 xx=xx+1:goto 136
  42. 185 yy=val(y$)
  43. 190 if yy>2500 or yy<1582 then gosub105:goto135
  44. 195 printtab(13):gosub720
  45. 200 print" month?[150] ";:m$=""
  46. 202 if xx>10 then xx=0
  47. 203 if xx>5 then print" [157]";:goto 207
  48. 205 print"[164][157]";
  49. 207 get a$
  50. 210 if a$=chr$(19) then115
  51. 215 if a$=chr$(20) then print:gosub720:gosub105:goto200
  52. 220 if a$=chr$(13) then print:s$=m$:gosub110:goto240
  53. 225 if a$<"0" or a$>"9" then237
  54. 230 if len(m$)>1 then 237
  55. 235 print a$;:m$=m$+a$
  56. 237 xx=xx+1:goto 202
  57. 240 mm=val(m$)
  58. 245 ifmm<1ormm>12 then gosub105:goto200
  59. 247 if yy=1582 and mm<10 then gosub 105:goto 200
  60. 250 printtab(13):gosub720
  61. 255 print" day  ?[150] ";:d$=""
  62. 257 if xx>10 then xx=0
  63. 258 if xx>5 then print" [157]";:goto 262
  64. 260 print"[164][157]";
  65. 262 get a$
  66. 265 if a$=chr$(19) then115
  67. 270 if a$=chr$(20) then print:gosub720:gosub105:goto255
  68. 275 if a$=chr$(13) then print:s$=d$:gosub110:dd=val(d$):goto305
  69. 280 if a$<"0" or a$>"9" then292
  70. 285 if len(d$)>1 then 292
  71. 290 print a$;:d$=d$+a$
  72. 292 xx=xx+1:goto 257
  73. 295 if mm=2 and dd>29 then gosub105:goto255
  74. 300 goto315
  75. 305 if((yy/4=int(yy/4))and(yy/100<>int(yy/100)))or(yy/400=int(yy/400))then295
  76. 310 if mm=2 and dd>28 then gosub105:goto255
  77. 315 if(mm=4 or mm=6 or mm=9 or mm=11)and dd>30 then gosub105:goto255
  78. 320 if dd<1 or dd>31 then gosub105:goto255
  79. 325 dd=dd-1
  80. 327 if yy=1582 and mm=10 and dd<14 then gosub 105:goto 255
  81. 330 printtab(13):gosub720
  82. 335 print" hour ?[150] ";:ah$="":ap$=""
  83. 337 if xx>8 then xx=0
  84. 338 if xx>4 then print" [157]";:goto 343
  85. 340 print"[164][157]";
  86. 343 get a$
  87. 345 a=val(a$)
  88. 350 if a$=chr$(19) then115
  89. 355 if a$=chr$(20) then print:gosub720:gosub105:goto335
  90. 360 if a$=chr$(13) then print:s$=ah$:gosub110:goto395
  91. 365 if a$="a" or a$="p" or a$="m" then375
  92. 370 if a$<"0" or a$>"9" then392
  93. 375 if len(ah$)>3 then 392
  94. 380 print a$;
  95. 385 if a$<>right$(str$(a),len(a$))then ap$=ap$+a$
  96. 390 ah$=ah$+a$
  97. 392 xx=xx+1:goto 337
  98. 395 ah=val(ah$)
  99. 400 if ah<1 or ah>12 then gosub105:goto335
  100. 405 aq$=right$(ah$,2)
  101. 410 if aq$<>ap$ then gosub105:goto335
  102. 415 if aq$<>"am" and aq$<>"pm" then gosub105:goto335
  103. 420 if ap$="am" and ah=12 then ah=0
  104. 425 if ap$="pm" and ah<12 then ah=ah+12
  105. 430 ah=ah/24
  106. 435 gosub720
  107. 440 if x=1 then yr=yy:mr=mm:dr=dd:ar=ah
  108. 445 for mn=1 to mm-1
  109. 450 dc=31
  110. 455 if mm=1 then dc=0
  111. 460 if mn=2 then dc=28
  112. 465 if mn=4 or mn=6 or mn=9 or mn=11 then dc=30
  113. 470 md=md+dc
  114. 475 next mn
  115. 480 if x=1 then m1=md:md=0
  116. 485 print:print:next x
  117. 490 printtab(14)"working...";
  118. 495 y1=yr*365:yd=yy*365:y=(yd+md+dd+ah)-(y1+m1+dr+ar):n=sgn(y):gosub690
  119. 505 ty=abs(y):y2=abs(ty)*1000+.5:yt=sgn(ty)*int(y2)/1000
  120. 510 ny=yt/365:df=ny-int(ny):nm=df*12:nd=df*365:hf=nd-int(nd):hr=hf*24
  121. 515 if hr>23.5 then nd=nd+1:hr=0
  122. 520 b=abs(nm)*10+.5:mn=sgn(nm)*int(b)/10:ys=int(ny)
  123. 525 if mn=12 then ys=int(ny)+1:mn=0
  124. 530 al=abs(l):ld=int(al):lf=al-ld:lh=lf*24:td=int(yt)+ld
  125. 535 th=hr+lh
  126. 540 if th>23.5 then td=td+1:th=hr+lh-24
  127. 545 gosub730
  128. 550 print"[157][157][157][157][157][157][157][157][157][157]          "
  129. 555 printtab(1)"[145][145][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184]"
  130. 560 printtab(15)"[145][157]or[157]";"[181][157]";"[181][157]";"[181][157]";"[181][157]";"[181][157]";"[181]"
  131. 565 printtab(3)"[145][145][145][145][145][145][145]years[155]"ys
  132. 570 printtab(2)"months[155]"mn
  133. 575 printtab(22)"[145][145]years[156]"int(ny)
  134. 580 printtab(23)"days[156]"int(nd)
  135. 585 printtab(22)"hours[156]"int(hr+.5)
  136. 590 printtab(18)"leap days[154]"ld;
  137. 595 print"hrs[154]"int(lh+.5)
  138. 600 printtab(17)"total days[159]"td
  139. 605 printtab(16)"total hours[159]"int(th+.5)
  140. 610 print:goto30
  141. 615 if n=1 then655
  142. 620 if mm<3 then630
  143. 625 if((yy/4=int(yy/4))and(yy/100<>int(yy/100)))or(yy/400=int(yy/400))thenl=l-1
  144. 630 if mr>2 then640
  145. 635 if((yr/4=int(yr/4))and(yr/100<>int(yr/100)))or(yr/400=int(yr/400))thenl=l-1
  146. 640 ifmm=2anddd=28thenl=l-ah:y=y-ah
  147. 645 ifmr=2anddr=28thenl=l+ar:y=y+ar
  148. 650 goto715
  149. 655 if mm>2 then665
  150. 660 if((yy/4=int(yy/4))and(yy/100<>int(yy/100)))or(yy/400=int(yy/400))thenl=l-1
  151. 665 if mr<3 then675
  152. 670 if((yr/4=int(yr/4))and(yr/100<>int(yr/100)))or(yr/400=int(yr/400))thenl=l-1
  153. 675 ifmm=2anddd=28thenl=l+ah:y=y-ah
  154. 680 ifmr=2anddr=28thenl=l-ar:y=y+ar
  155. 685 goto715
  156. 690 for x=yy to yr step1*sgn(yr-yy)
  157. 695 if((x/4=int(x/4))and(x/100<>int(x/100)))or(x/400=int(x/400))then l=l+1
  158. 700 next
  159. 705 if((yy/4=int(yy/4))and(yy/100<>int(yy/100)))or(yy/400=int(yy/400))then615
  160. 710 if((yr/4=int(yr/4))and(yr/100<>int(yr/100)))or(yr/400=int(yr/400))then615
  161. 715 return
  162. 720 pokesd+5,8:pokesd+6,240:pokesd,0:pokesd+1,90:pokesd+4,17:fors=1to100:next
  163. 725 goto735
  164. 730 pokesd+5,8:pokesd+6,240:pokesd,0:pokesd+1,90:pokesd+4,17:fors=1to500:next
  165. 735 pokesd+4,0:pokesd,0:pokesd+1,0:return
  166.